/* AI智能体开发平台 - 自定义样式 */

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #333333;
    background-color: #F0F2F5;
    line-height: 1.5;
}

/* 布局容器 */
.za-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.za-header {
    height: 60px;
    background-color: #FFFFFF;
    border-bottom: 1px solid #E5E6EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.za-logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
    color: #165DFF;
}

.za-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.za-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #165DFF;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}

.za-nickname {
    font-size: 14px;
    color: #333333;
}

.za-logout-btn {
    color: #666666;
    cursor: pointer;
    font-size: 14px;
}

.za-logout-btn:hover {
    color: #165DFF;
}

/* 主体内容区域 */
.za-main {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* 左侧菜单栏 */
.za-sidebar {
    width: 240px;
    background-color: #FFFFFF;
    border-right: 1px solid #E5E6EB;
    overflow-y: auto;
    transition: width 0.3s ease;
}

.za-sidebar.collapsed {
    width: 64px;
}

.za-menu {
    padding: 16px 0;
}

.za-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #666666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.za-menu-item:hover {
    background-color: #F0F2F5;
    color: #165DFF;
}

.za-menu-item.active {
    background-color: #E6F7FF;
    color: #165DFF;
    border-right: 3px solid #165DFF;
}

.za-menu-icon {
    font-size: 18px;
    margin-right: 12px;
}

.za-menu-text {
    font-size: 14px;
}

.za-sidebar.collapsed .za-menu-text {
    display: none;
}

.za-sidebar.collapsed .za-menu-item {
    justify-content: center;
    padding: 12px 0;
}

.za-sidebar.collapsed .za-menu-icon {
    margin-right: 0;
}

/* 主内容区域 */
.za-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #F0F2F5;
}

.za-iframe-container {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 100px);
    background-color: #FFFFFF;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.za-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 按钮样式 - 自定义样式 */
.za-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 400;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    outline: none;
    height: 36px; /* 增加默认按钮高度 */
}

.za-btn-primary {
    background-color: #165DFF;
    color: #FFFFFF;
}

.za-btn-primary:hover {
    background-color: #4080FF;
}

.za-btn-primary:active {
    background-color: #0E42D2;
}

.za-btn-secondary {
    background-color: #FFFFFF;
    color: #165DFF;
    border: 1px solid #165DFF;
}

.za-btn-secondary:hover {
    background-color: #F0F8FF;
}

.za-btn-danger {
    background-color: #F53F3F;
    color: #FFFFFF;
}

.za-btn-danger:hover {
    background-color: #FF6B6B;
}

/* 按钮尺寸 - 确保所有尺寸都有足够的高度 */
.za-btn-lg {
    height: 44px;
    font-size: 16px;
    padding: 0 24px;
}

.za-btn-md {
    height: 36px;
    font-size: 14px;
}

.za-btn-sm {
    height: 32px;
    font-size: 13px;
    padding: 0 12px;
}

/* 按钮容器样式，用于按钮组布局 */
.za-btn-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 输入框样式 */
.za-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    border: 1px solid #DCDFE6;
    border-radius: 4px;
    transition: all 0.3s ease;
    outline: none;
    background-color: #FFFFFF;
}

.za-input:focus {
    border-color: #165DFF;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}

.za-input::placeholder {
    color: #C0C4CC;
}

/* 智能体卡片样式 */
.za-agent-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.za-agent-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* 保持卡片内部间距和内容样式 */
.za-agent-card .layui-card-body {
  padding: 20px;
}

.za-agent-name {
  font-size: 18px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 12px;
}

.za-agent-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: #606266;
}

.za-agent-desc {
  font-size: 14px;
  color: #606266;
  line-height: 1.6;
  margin-bottom: 16px;
  height: 60px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.za-agent-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* 确保响应式布局在不同屏幕尺寸下正确显示 */
@media screen and (max-width: 768px) {
  .za-agent-actions {
    flex-wrap: wrap;
  }
  
  .za-agent-actions .za-btn {
    flex: 1;
    min-width: 80px;
  }
}

/* 表单相关样式 */
.layui-form-label {
  font-weight: 500;
  color: #303133;
}

.layui-input, .layui-textarea {
  border-radius: 4px;
  transition: all 0.3s;
  border-color: #dcdfe6;
}

.layui-input:focus, .layui-textarea:focus {
  border-color: #165DFF;
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}

/* 表单验证提示 */
.layui-form-item .layui-form-error {
  color: #ff4d4f;
}

.layui-form-item .layui-input-block .layui-form-mid {
  margin-top: 8px;
}

/* 响应式表单 */
@media screen and (max-width: 768px) {
  .layui-input, .layui-textarea {
    width: 100% !important;
  }
  
  .layui-form-label {
    width: 100% !important;
    text-align: left;
  }
  
  .layui-input-block {
    margin-left: 0 !important;
  }
  
  .layui-form-item[style*="margin-left"] {
    margin-left: 0 !important;
  }
}

/* 知识库管理页面样式 */
.page-header h2 {
    color: #303133;
    font-size: 24px;
    font-weight: 500;
    margin: 0;
}

.page-header p {
    color: #909399;
    font-size: 14px;
    margin-top: 8px;
}

/* 表格相关样式 */
.layui-table {
    border-radius: 4px;
    overflow: hidden;
}

.layui-table th {
    background-color: #f5f7fa;
    color: #606266;
    font-weight: 500;
}

.layui-table tbody tr:hover {
    background-color: #fafafa;
}

/* 按钮组样式 */
.btn-group .za-btn {
    margin-left: 0;
    margin-right: 10px;
}

.btn-group .za-btn:last-child {
    margin-right: 0;
}

/* 弹窗样式优化 */
.layui-layer-content {
    padding: 20px;
}

/* 搜索框样式 */
.layui-input-inline {
    margin-right: 10px;
}

/* 知识内容预览样式 */
.knowledge-preview {
    color: #606266;
    font-size: 14px;
    line-height: 1.6;
}

/* 批量操作按钮状态 */
.batch-action-hidden {
    display: none;
}

/* 表格复选框列宽调整 */
.layui-table-col-special {
    width: 40px !important;
}

/* 滚动条样式优化 */
.layui-table-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.layui-table-body::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.layui-table-body::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 3px;
}

/* 标签样式 */
.za-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
    margin-right: 8px;
}

.za-tag-public {
    background-color: #E6F7FF;
    color: #165DFF;
}

.za-tag-private {
    background-color: #F5F7FA;
    color: #909399;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .za-sidebar {
        width: 64px;
    }
    
    .za-sidebar .za-menu-text {
        display: none;
    }
    
    .za-sidebar .za-menu-item {
        justify-content: center;
        padding: 12px 0;
    }
    
    .za-sidebar .za-menu-icon {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .za-header {
        padding: 0 12px;
    }
    
    .za-content {
        padding: 12px;
    }
    
    .za-sidebar {
        position: fixed;
        left: -240px;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 1000;
    }
    
    .za-sidebar.open {
        left: 0;
    }
    
    .za-agent-card {
        width: 100%;
    }
}

/* 加载动画 */
.za-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #165DFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示框样式 */
.za-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 4px;
    color: #FFFFFF;
    font-size: 14px;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.za-message-success {
    background-color: #52C41A;
}

.za-message-error {
    background-color: #F53F3F;
}

.za-message-warning {
    background-color: #FAAD14;
    color: #333333;
}

.za-message-info {
    background-color: #165DFF;
}